<template>
  <el-radio-group v-model="radioValue">
    <el-radio
      v-for="item in radioOptions"
      :key="item.id"
      :label="item.id">
      {{ item.ynName }}
    </el-radio>
  </el-radio-group>
</template>

<script>
export default {
  name: "redio",
  data() {
    return {
      radioValue: '', // 选中的单选按钮的值
      radioOptions: [] // 存储从接口获取的数据
    };
  },
  created() {
    this.fetchRadioOptions();
  },
  methods: {
    fetchRadioOptions() {
      // 假设 getRadioData 是一个返回 Promise 的函数，用来获取接口数据
      this.axios.post('/ynDepartment/list').then(response => {
        this.radioOptions = response.data.data; // 假设响应格式为 { data: [] }
      });
    }
  }
}
</script>

<style scoped>

</style>
